require("datastream")
include("shared.lua")
include("client/cl_util.lua")
include("client/cl_hints.lua")
include("client/cl_hud.lua")
include("client/cl_deaths.lua")
include("client/cl_helpvgui.lua")
include("client/cl_msg.lua")
include("client/cl_menu.lua")
include("client/cl_spawnmenu.lua")
include("client/cl_chat.lua")
include("client/cl_inventory.lua")
include("admin/cl_admin.lua")
include("admin/ersmodule.lua")

//modify the undo menu in Q menu->Utilities tab
local function PopulateUtilityMenus()
	spawnmenu.AddToolMenuOption("Utilities", "User", "User_Cleanup", "#Cleanup", "", "", function(CPanel) CPanel:AddControl("Header", {Text = "#Cleanup"}) end)
end
hook.Add("PopulateToolMenu", "PopulateUtilityMenus", PopulateUtilityMenus)
local function CreateUtilitiesCategories()
	spawnmenu.AddToolCategory( "Utilities", "User", "#User")
end
hook.Add("AddToolMenuCategories", "CreateUtilitiesCategories", CreateUtilitiesCategories)

GUIToggled = false
HelpToggled = false

HelpLabels = { }
HelpCategories = { }

AdminTellAlpha = -1
AdminTellStartTime = 0
AdminTellMsg = ""

MoneyAlpha = -1
MoneyY = 0
MoneyAmount = 0

afkbigness = 255
afkdir = true

StunStickFlashAlpha = -1

local viewpl = nil
local viewpltime = 0

local viewstructure = nil
local viewstructuretime = 0

local tsize = 12
if ScrW()>1000 then
	tsize=16
end

language.Add("smg1_ammo", "Rifle Ammo")						
language.Add("pistol_ammo", "Pistol Ammo")						
language.Add("sniperround_ammo", "Sniper Ammo")		
language.Add("battery_ammo", "Grenades")		
language.Add("gravity_ammo", "Grenades")						
language.Add("alyxgun_ammo", "PipeBombs")						
language.Add("CombineCannon_ammo", "Flamethrower Fuel")
language.Add("SMG_ammo", "Rifle Rounds")
language.Add("SLAM_ammo", "Grenades")
language.Add("XBowBolt_ammo", "Dart Gun Bolts")
language.Add("env_fire", "Fire")
language.Add("env_physexplosion", "The Game")
language.Add("entityflame", "Flames")
language.Add("SBoxLimit_magnets", "You have hit the Magnet limit!")
language.Add("env_laser", "Laser")
language.Add("env_explosion", "Explosion")
language.Add("func_door", "Door")
language.Add("func_door_rotating", "Door")
language.Add("trigger_hurt", "Hazard")
language.Add("func_rotating", "Hazard")
language.Add("worldspawn", "Gravity")

surface.CreateFont("ChatFont", 72, 700, true, false, "AFKFont")
surface.CreateFont("TabLarge", tsize, 500, true, false, "MessageFont")
surface.CreateFont("akbar", 20, 500, true, false, "AckBarWriting")
surface.CreateFont("HalfLife2", 96, 500, true, false, "HL2Symbols")
surface.CreateFont("Hazard", 34, 300, true, true, "HUDBarFont")
surface.CreateFont("Graffiare", 28, 200, true, true, "AmmoFont")
surface.CreateFont("Verdana", 12, 300, true, true, "AmmoFontSmall")
surface.CreateFont("ChatFont", 22, 400, true, false, "ArmorFont")
surface.CreateFont("csd", 32, 400, true, false, "DrugFont")
surface.CreateFont("Counter-Strike", 32, 400, true, false, "CSDFont")
surface.CreateFont("HalfLife2", 50, 400, true, false, "DrugFont2")
surface.CreateFont("Trebuchet MS", 32, 800, true, false, "AmmoFont")
	
function GM:Initialize()
	self.BaseClass:Initialize()
end

function GetTextHeight(font, str)

	surface.SetFont(font)
	local w, h = surface.GetTextSize(str)
	return h
	
end

function ShockWaveExplosion(pos, ply, hitnorm, rad)
	rad = math.Round(rad)
	local efdt = EffectData()
		efdt:SetStart(pos)
		efdt:SetOrigin(pos)
		efdt:SetScale(1)
		efdt:SetRadius(rad)
		efdt:SetNormal(hitnorm)
	util.Effect("cball_bounce",efdt)
end
